﻿<UserControl x:Class="MedicinesControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
              xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
              xmlns:lib="clr-namespace:HMSLibrary;assembly=HMSLibrary">
    <Grid>
        <Grid Name="MainGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBlock Text="Code :" Style="{StaticResource TextBlockStyle}" Grid.Row="1"/>
            <extToolkit:WatermarkTextBox Grid.Column="1" Grid.Row="1" Watermark="Item Code" Name="ItemCodeTextBox" Margin="2"/>
            <TextBlock Text="Strenght :" Grid.Column="2" Style="{StaticResource TextBlockStyle}" Grid.Row="1"/>
            <extToolkit:WatermarkTextBox Grid.Column="3" Grid.Row="1" Watermark="Strenght" Name="StrenghtCodeTextBox" Margin="2"/>
            <TextBlock Text="Name:" Style="{StaticResource TextBlockStyle}"/>
            <extToolkit:WatermarkTextBox Grid.Column="1" Grid.ColumnSpan="3" Watermark="Name" Name="ItemNameTextBox" Margin="2"/>
            <TextBlock Text="Medicine Type:" Grid.Row="2" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox Grid.Column="1" Grid.Row="2" Margin="2" Grid.ColumnSpan="3" Name="MedicineTypeComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="Generic Drug:" Grid.Row="3" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox Grid.Column="1" Grid.Row="3" Margin="2" Grid.ColumnSpan="3" Name="GenericDrugComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="Manufacturer:" Grid.Row="4" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox Grid.Column="1" Grid.Row="4" Margin="2" Grid.ColumnSpan="3" Name="ManufacturerComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="Category:" Grid.Row="5" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox Grid.Column="1" Grid.Row="5" Margin="2" Grid.ColumnSpan="3" Name="CategoryComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="Sub Category :" Grid.Row="6" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox Grid.Column="1" Grid.Row="6" Margin="2" Grid.ColumnSpan="3" Name="SubCategoryComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="Shelf No:" Grid.Row="7" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox IsEditable="True" Grid.Column="1" Width="110" Grid.Row="7" Margin="2" Name="ShelfNoComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="Rack No:" Grid.Row="7" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox IsEditable="True" Grid.Row="7" Width="110" Grid.Column="3" Margin="2" Name="RackNoComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="Box No:" Grid.Row="8" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox IsEditable="True" Grid.Column="1" Width="110" Grid.Row="8" Margin="2" Name="BoxNoComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="ROL :" Grid.Row="8" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>
            <extToolkit:WatermarkTextBox Grid.Column="3" Watermark="Re-Order Level" Grid.Row="8" Name="ROLTextBox" Margin="2"/>
            <TextBlock Text="Composition :" Grid.Row="9" Style="{StaticResource TextBlockStyle}"/>
            <extToolkit:WatermarkTextBox Grid.Column="1" Watermark="Composition" Grid.Row="9" Grid.ColumnSpan="3" Height="50" Name="CompositionTextBox" Margin="2"/>
            <TextBlock Text="Remark :" Grid.Row="10" Style="{StaticResource TextBlockStyle}"/>
            <extToolkit:WatermarkTextBox Grid.Column="1" Grid.ColumnSpan="3" Height="50" Watermark="Remarks" Grid.Row="10" Name="RemarkTextBox" Margin="2" AcceptsReturn="True" TextWrapping="WrapWithOverflow" VerticalScrollBarVisibility="Auto"/>
        </Grid>
        <StackPanel Name="FindStackPanel" Visibility="Collapsed">
            <lib:SearchBox x:Name="Ctrl" HorizontalAlignment="Right" Margin="10,5"
					Width="249" Height="22" Mode="{Binding SelectedValue.Content, ElementName=SearchMode}"
					Prompt="Search text" ToolTip="Type to search the current view">
                <lib:SearchBox.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Option 1" IsCheckable="True"/>
                        <MenuItem Header="Option 2" IsCheckable="True"/>
                    </ContextMenu>
                </lib:SearchBox.ContextMenu>
                <lib:SearchBox.LayoutTransform>
                    <ScaleTransform ScaleX="{Binding Value, ElementName=Scaler}" 
																						ScaleY="{Binding Value, ElementName=Scaler}"/>
                </lib:SearchBox.LayoutTransform>
            </lib:SearchBox>
            <extToolkit:BusyIndicator Name="BusyIndicator1" Grid.ColumnSpan="3"/>
            <ScrollViewer Margin="5" MaxHeight="250">
                <my:DataGrid Grid.Row="2" Name="SearchDataGrid" Style="{StaticResource SerachDataGridStyle}">
                    <my:DataGrid.Columns>
                        <my:DataGridTemplateColumn Width="20">
                            <my:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Button Template="{StaticResource DeleteButtonTemp}" Name="DeleteButton" Click="DeleteButton_Click"/>
                                </DataTemplate>
                            </my:DataGridTemplateColumn.CellTemplate>
                        </my:DataGridTemplateColumn>
                        <my:DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
                        <my:DataGridTextColumn Header="Item Code" Binding="{Binding ItemCode}"/>
                        <my:DataGridTextColumn Header="Generic Drug" Binding="{Binding genericDrugName}"/>
                        <my:DataGridTextColumn Header="Manufacturer" Binding="{Binding mfgName}"/>
                        <my:DataGridTextColumn Header="Medicine Type" Binding="{Binding medicineTypeName}"/>
                        <my:DataGridTextColumn Header="Strenght" Binding="{Binding strenght}"/>
                        <my:DataGridTextColumn Header="Composition" Binding="{Binding composition}"/>
                        <my:DataGridTextColumn Header="Category" Binding="{Binding CategoryName}"/>
                        <my:DataGridTextColumn Header="Sub Category" Binding="{Binding SubCategoryName}"/>
                        <my:DataGridTextColumn Header="Shelf No" Binding="{Binding shelfNo}"/>
                        <my:DataGridTextColumn Header="Rack No" Binding="{Binding rackNo}"/>
                        <my:DataGridTextColumn Header="Box No" Binding="{Binding boxNo}"/>
                        <my:DataGridTextColumn Header="Remarks" Binding="{Binding Description}"/>
                    </my:DataGrid.Columns>
                </my:DataGrid>
            </ScrollViewer>
        </StackPanel>
    </Grid>
</UserControl>
